# 这是一个关于蚕自我生存的程序
import random
import time
# 起始时间
star=time.time()

pupa=['1号实验题']
pupa_food=[random.randint(1,10)]
pupa_water=[random.randint(1,10)]


while True:
    if pupa_food[0]==0 or pupa_water[i]==0:
        break
    elif random.randint(0,2)==0:
        pupa_food[0]+=1
    elif random.randint(0,2)==1:
        pupa_water[0]+=1
    else:
        pupa_food[0]-=1
        pupa_water[0]-=1
    time.sleep(5)
#     打印属性
    for i in range(len(pupa)):
        print('实验题名称:{}'.format(pupa[i]),end='\t')
        print('食物量:{:d}'.format(pupa_food[i]),end='\t')
        print('水含量:{:d}'.format(pupa_water[i]))
    
    
# 结束时间
end=time.time()
print('实验题共生存了{:.2f}秒'.format(end-star))